<ui:composition 
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:c="http://java.sun.com/jsp/jstl/core"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:p="http://primefaces.org/ui">
    
    
  
    <h:form id="test">  
  
    <p:dataTable id="dataTable" var="car" value="#{tableBean.carsSmall}" widgetVar="carsTable"   
            emptyMessage="No cars found with given criteria" filteredValue="#{tableBean.filteredCars}">  

         <f:facet name="header">  
            <p:outputPanel>  
                <h:outputText value="Search all fields:" />  
                <p:inputText id="globalFilter" onkeyup="carsTable.filter()" style="width:150px" />  
            </p:outputPanel>  
        </f:facet>  
  
        <p:column id="modelColumn" filterBy="#{car.model}"   
                headerText="Model" footerText="contains"  
                filterMatchMode="contains">  
            <h:outputText value="#{car.model}" />  
        </p:column>  
  
        <p:column id="yearColumn" filterBy="#{car.year}"  
                headerText="Year" footerText="startsWith">  
            <h:outputText value="#{car.year}" />  
        </p:column>  
  
        
  
        <p:column id="colorColumn" filterBy="#{car.color}"  
                headerText="Color" footerText="endsWith" filterMatchMode="endsWith">  
            <h:outputText value="#{car.color}" />  
        </p:column>    
        
    </p:dataTable>  
</h:form>
</ui:composition>